package com.rpframework.module.common.bottom.service.impl;

import com.rpframework.module.common.bottom.entity.RegionCity;
import com.rpframework.module.common.bottom.mapper.RegionCityMapper;
import com.rpframework.module.common.bottom.service.RegionCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;


/**
 * 默认实现
 * Created by jump on 2016/7/4.
 */
@Service
public class RegionCityServiceImpl extends BaseMapperImpl<RegionCity> implements RegionCityService {
    @Autowired
    public RegionCityServiceImpl(RegionCityMapper mapper) {
        super.mapper = mapper;
    }

    @Override
    public Example getExample() {
        return new Example(RegionCity.class);
    }

    @Override
    public List<RegionCity> selectCodes(List<Integer> codes) {
        Example example = getExample();
        example.createCriteria().andIn("code", codes);
        return selectByExample(example);
    }
}
